﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cdm.Test
{
    public class Program
    {
        public class Student
        {
            public int Id { get; set; }
            public string Name { get; set; }
            public int Age { get; set; }
        }
        public static void Main()
        {
            List<Student> students = new List<Student>()
            {
              new Student()
              {
                Id=1,
                Name="01",
                Age=10
              },
              new Student()
              {
                Id=2,
                Name="02",
                Age=10
              },
              new Student()
              {
                Id=3,
                Name="02",
                Age=20
              },
              new Student()
              {
                Id=4,
                Name="02",
                Age=20
              }
            };

            var lst = students.Where(x => x.Name == "02")
                .Select(x => x.Name)
                //.Distinct(x => x.Id)
                //.Skip(1)
                .Take(2)
                .ToList();
            // Console.WriteLine(lst);
            foreach (var item in lst)
            {
                Console.WriteLine(item);
            }
        }
    }

}
